package com.easy.frame.base.basic.pojo.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * 树状图通用视图对象
 *
 * @author zzf
 * @date 2020/7/30 8:57
 */
@Getter
@Setter
@ToString
@ApiModel("树状图通用视图对象")
public class TreeVO implements Serializable {

    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("名字")
    private String name;

    @ApiModelProperty("短编码")
    private String path;

    @ApiModelProperty("是否启用 [0禁用 1启用]")
    private Integer enabled;

    @ApiModelProperty("排序号")
    private Integer orderNum;

    @ApiModelProperty(value = "是否虚拟表 [0不是 1是]", dataType = "Integer")
    private Integer isVirtual;

    @ApiModelProperty("子节点list")
    private List<TreeVO> childList;

    public static TreeVO head() {
        TreeVO treeVO = new TreeVO();
        treeVO.setOrderNum(0);
        treeVO.setName("所有");
        treeVO.setEnabled(1);
        return treeVO;
    }
}